package StudentControl.StudentManager;

import Domain.User;
import Domain.Student;

import java.util.ArrayList;
import java.util.Scanner;

public class StudentManager {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //登录系统
        ArrayList<Student> studentsList = new ArrayList<>();
        ArrayList<User> userList = new ArrayList<>();
        while (true) {
            //登录界面
            LogIn userIn = new LogIn(userList);
            userIn.UserIn(userList);

            //选择管理系统
            loop:while (true) {
                System.out.println("=========请输入您的选择=========");
                System.out.println("1.教师系统");
                System.out.println("2.学生系统");
                System.out.println("3.返回上一级");
                String choice = sc.nextLine();
                switch (choice){
                    case "1":
                        //教师登录
                        TeacherIn tecIn = new TeacherIn(studentsList);
                        tecIn.teacherLogin(studentsList);
                        break;
                    case "2":
                        //学生登录
                        StudentIn stuIn = new StudentIn(studentsList);
                        stuIn.studentLogin(studentsList);
                        break;
                    case "3":
                        System.out.println("返回上一级");
                        break loop;
                    default:
                        System.out.println("您的输入有误！");
                        break;
                }
            }
        }
    }
}
